package com.dianxin.smartpark.web.property;

import java.util.List;

import cn.dev33.satoken.annotation.SaCheckPermission;
import com.chinatelecom.response.common.CommonResponseBody;
import com.dianxin.smartpark.dao.qo.property.SmartParkPropertyWaterQO;
import com.dianxin.smartpark.service.property.SmartParkPropertyWaterService;
import com.dianxin.smartpark.service.vo.property.SmartParkPropertyWaterVO;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.PutMapping;
import org.springframework.web.bind.annotation.DeleteMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

/**
 * 送水管理
 * 
 * @author chenjiasong
 * @date 2021-07-28
 */
@RestController
@RequestMapping("/smartpark/water")
public class SmartParkPropertyWaterController
{
    @Resource
    private SmartParkPropertyWaterService smartParkPropertyWaterService;

    /**
     * 查询送水管理列表
     */
    @GetMapping("/list")
    @SaCheckPermission(value = "/smartpark/water/list")
    public CommonResponseBody<List<SmartParkPropertyWaterVO>>  list(SmartParkPropertyWaterQO qo)
    {
        return smartParkPropertyWaterService.selectSmartParkPropertyWaterList(qo);
    }


    /**
     * 获取送水管理详细信息
     */
    @GetMapping(value = "/getInfo")
    @SaCheckPermission(value = "/smartpark/water/getInfo")
    public CommonResponseBody<SmartParkPropertyWaterVO> getInfo(SmartParkPropertyWaterQO qo)
    {
        return smartParkPropertyWaterService.selectSmartParkPropertyWater(qo);
    }

    /**
     * 新增送水管理
     */
    @PostMapping("/add")
    @SaCheckPermission(value = "/smartpark/water/add")
    public  CommonResponseBody<Boolean> add(@RequestBody SmartParkPropertyWaterVO vo)
    {
        return smartParkPropertyWaterService.insertSmartParkPropertyWater(vo);
    }

    /**
     * 修改送水管理
     */
    @PutMapping("/edit")
    @SaCheckPermission(value = "/smartpark/water/edit")
    public  CommonResponseBody<Boolean> edit(@RequestBody SmartParkPropertyWaterVO vo)
    {
        return smartParkPropertyWaterService.updateSmartParkPropertyWater(vo);
    }

    /**
     * 删除送水管理
     */
	@DeleteMapping("/remove")
    @SaCheckPermission(value = "/smartpark/water/remove")
    public  CommonResponseBody<Boolean> remove(@RequestBody SmartParkPropertyWaterVO vo)
    {
        return smartParkPropertyWaterService.deleteSmartParkPropertyWater(vo);
    }
}
